// 合同
export const columns1 = [
  {
    title: '合同记录',

    dataIndex: 'licenseCompanyName',
    align: 'left',
    customRender: ({ record }) => {
      return record.contractResponse?.licenseCompanyName || '-';
    },
  },
  {
    title: '项目名称',
    dataIndex: 'projectName',

    align: 'left',

    customRender: ({ record }) => {
      return record.contractResponse?.projectName || '-';
    },
  },
  {
    title: '金额',
    dataIndex: 'amount',

    align: 'left',

    customRender: ({ record }) => {
      return record.contractResponse?.amount || '-';
    },
  },
  {
    title: '签订时间',
    dataIndex: 'signDate',

    align: 'left',

    customRender: ({ record }) => {
      return record.contractResponse?.signDate || '-';
    },
  },
  {
    title: '甲方',
    dataIndex: 'firstParty',

    align: 'left',

    customRender: ({ record }) => {
      return record.contractResponse?.firstParty || '-';
    },
  },
  // {
  //   title: '资质公司编号',
  //   dataIndex: 'licenseCompanyId',
  //
  //   align: 'left',

  //   customRender: ({ record }) => {
  //     return record.contractResponse?.licenseCompanyId || '-';
  //   },
  // },
  // {
  //   title: '资质公司名称',
  //   dataIndex: 'licenseCompanyName',
  //
  //   align: 'left',

  //   customRender: ({ record }) => {
  //     return record.contractResponse?.licenseCompanyName || '-';
  //   },
  // },
  {
    title: '附件',
    dataIndex: 'url',
    slots: { customRender: 'contractResponseUrl' },

    align: 'left',
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',

    align: 'left',

    customRender: ({ record }) => {
      return record.contractResponse?.createTime || '-';
    },
  },
  {
    title: '操作',
    dataIndex: 'contractResponseAction',
    slots: { customRender: 'contractResponseAction' },

    width: 80,
    align: 'left',
  },
];

// 出图记录
export const columns2 = [
  {
    title: '出图记录',

    align: 'left',
    dataIndex: 'licenseCompanyName',
    customRender: ({ record }) => {
      return record.designResponse?.licenseCompanyName || '-';
    },
  },

  {
    title: '项目名称',
    dataIndex: 'projectName',

    align: 'left',

    customRender: ({ record }) => {
      return record.designResponse?.projectName || '-';
    },
  },
  {
    title: '出图类型',
    dataIndex: 'types',

    align: 'left',

    customRender: ({ record }) => {
      const obj = {
        10: '方案文本',
        11: '施工图',
        12: '报建图',
      };

      // return obj[record.designResponse?.types] || '-';
      let str = '';
      const arr = record.designResponse?.types || [];
      arr.forEach((item, index) => {
        str += index == 0 ? obj[item] : `,${obj[item]}`;
      });
      return str || '-';
    },
  },
  {
    title: '印章类型',
    dataIndex: 'seals',

    align: 'left',

    customRender: ({ record }) => {
      const obj = {
        10: '公章',
        11: '建筑出图章',
        12: '建筑注册师章',
        13: '结构注册师章',
        14: '规划出图章',
        15: '市政出图章',
        16: '注册规划师章',
      };
      // return obj[record.designResponse?.seals] || '-';

      let str = '';
      const arr = record.designResponse?.seals || [];
      arr.forEach((item, index) => {
        str += index == 0 ? obj[item] : `,${obj[item]}`;
      });
      return str || '-';
    },
  },
  {
    title: '出图盖章时间',
    dataIndex: 'signDate',

    align: 'left',

    customRender: ({ record }) => {
      return record.designResponse?.signDate || '-';
    },
  },
  {
    title: '数量',
    dataIndex: 'number',

    align: 'left',

    customRender: ({ record }) => {
      return record.designResponse?.number || '-';
    },
  },
  {
    title: '附件',
    dataIndex: 'url',
    slots: { customRender: 'designResponseUrl' },
    align: 'left',
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',

    align: 'left',

    customRender: ({ record }) => {
      return record.designResponse?.createTime || '-';
    },
  },
  {
    title: '操作',
    dataIndex: 'designResponseAction',
    slots: { customRender: 'designResponseAction' },

    width: 80,
    align: 'left',
  },
];

// 验收记录
export const columns3 = [
  {
    title: '验收记录',

    align: 'left',
    dataIndex: 'licenseCompanyName',
    customRender: ({ record }) => {
      return record.checkResponse?.licenseCompanyName || '-';
    },
  },

  {
    title: '项目名称',
    dataIndex: 'projectName',

    align: 'left',

    customRender: ({ record }) => {
      return record.checkResponse?.projectName || '-';
    },
  },
  {
    title: '类型',
    dataIndex: 'types',

    align: 'left',

    customRender: ({ record }) => {
      const obj = {
        10: '基槽验收',
        11: '基础验收',
        12: '主体验收 ',
        13: '竣工验收',
      };
      // return obj[record.checkResponse?.types] || '-';
      let str = '';
      const arr = record.checkResponse?.types || [];
      arr.forEach((item, index) => {
        str += index == 0 ? obj[item] : `,${obj[item]}`;
      });
      return str || '-';
    },
  },
  {
    title: '盖章',
    dataIndex: 'seals',

    align: 'left',

    customRender: ({ record }) => {
      const obj = {
        10: '公章',
        11: '技术章',
      };
      // return obj[record.checkResponse?.seals] || '-';
      let str = '';
      const arr = record.checkResponse?.seals || [];
      arr.forEach((item, index) => {
        str += index == 0 ? obj[item] : `,${obj[item]}`;
      });
      return str || '-';
    },
  },
  {
    title: '盖章时间',
    dataIndex: 'signDate',

    align: 'left',

    customRender: ({ record }) => {
      return record.checkResponse?.signDate || '-';
    },
  },
  {
    title: '数量',
    dataIndex: 'number',

    align: 'left',

    customRender: ({ record }) => {
      return record.checkResponse?.number || '-';
    },
  },
  {
    title: '附件',
    dataIndex: 'url',
    slots: { customRender: 'checkResponseUrl' },

    align: 'left',
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',

    align: 'left',

    customRender: ({ record }) => {
      return record.checkResponse?.createTime || '-';
    },
  },
  {
    title: '操作',
    dataIndex: 'checkResponseAction',
    slots: { customRender: 'checkResponseAction' },

    width: 80,
    align: 'left',
  },
];

// 发票记录
export const columns4 = [
  {
    title: '发票记录',

    align: 'left',
    dataIndex: 'licenseCompanyName',
    customRender: ({ record }) => {
      return record.invoiceResponse?.licenseCompanyName || '-';
    },
  },

  {
    title: '项目名称',
    dataIndex: 'projectName',

    align: 'left',

    customRender: ({ record }) => {
      return record.invoiceResponse?.projectName || '-';
    },
  },
  {
    title: '类型',
    dataIndex: 'types',

    align: 'left',

    customRender: ({ record }) => {
      const obj = {
        10: '普通增值税发票',
        11: '普通增值税专用发票',
      };
      return obj[record.invoiceResponse?.type] || '-';
    },
  },
  {
    title: '金额',
    dataIndex: 'amount',

    align: 'left',

    customRender: ({ record }) => {
      return record.invoiceResponse?.amount || '-';
    },
  },
  {
    title: '甲方抬头',
    dataIndex: 'firstParty',

    align: 'left',

    customRender: ({ record }) => {
      return record.invoiceResponse?.firstParty || '-';
    },
  },
  {
    title: '纳税人识别号',
    dataIndex: 'taxCode',

    align: 'left',

    customRender: ({ record }) => {
      return record.invoiceResponse?.taxCode || '-';
    },
  },
  {
    title: '甲方电话',
    dataIndex: 'phone',

    align: 'left',

    customRender: ({ record }) => {
      return record.invoiceResponse?.phone || '-';
    },
  },
  {
    title: '甲方地址',
    dataIndex: 'address',

    align: 'left',

    customRender: ({ record }) => {
      return record.invoiceResponse?.address || '-';
    },
  },
  {
    title: '附件',
    dataIndex: 'url',
    slots: { customRender: 'invoiceResponseUrl' },

    align: 'left',
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',

    align: 'left',

    customRender: ({ record }) => {
      return record.invoiceResponse?.createTime || '-';
    },
  },
  {
    title: '操作',
    dataIndex: 'invoiceResponseAction',
    slots: { customRender: 'invoiceResponseAction' },

    width: 80,
    align: 'left',
  },
];
// 招投标记录
export const columns5 = [
  {
    title: '投标公司',

    align: 'left',
    dataIndex: 'licenseCompanyName',
    customRender: ({ record }) => {
      return record.tenderResponse?.licenseCompanyName || '-';
    },
  },

  {
    title: '项目名称',
    dataIndex: 'projectName',

    align: 'left',

    customRender: ({ record }) => {
      return record.tenderResponse?.projectName || '-';
    },
  },
  {
    title: '类型',
    dataIndex: 'types',

    align: 'left',

    customRender: ({ record }) => {
      const obj = {
        10: '建筑设计',
        11: '城乡规划',
        12: '景观项目',
        13: '市政项目',
        14: '勘察项目',
        15: '施工项目',
      };
      // return obj[record.tenderResponse?.types] || '-';
      let str = '';
      const arr = record.tenderResponse?.types || [];
      arr.forEach((item, index) => {
        str += index == 0 ? obj[item] : `,${obj[item]}`;
      });
      return str || '-';
    },
  },
  // {
  //   title: '资质公司编号',
  //   dataIndex: 'licenseCompanyId',
  //
  //   align: 'left',

  //   customRender: ({ record }) => {
  //     return record.tenderResponse?.licenseCompanyId || '-';
  //   },
  // },
  // {
  //   title: '资质公司名称',
  //   dataIndex: 'licenseCompanyName',

  //   align: 'left',

  //   customRender: ({ record }) => {
  //     return record.tenderResponse?.licenseCompanyName || '-';
  //   },
  // },
  {
    title: '报名时间',
    dataIndex: 'signDate',

    align: 'left',

    customRender: ({ record }) => {
      return record.tenderResponse?.signDate || '-';
    },
  },
  {
    title: '开标时间',
    dataIndex: 'openDate',

    align: 'left',

    customRender: ({ record }) => {
      return record.tenderResponse?.openDate || '-';
    },
  },
  {
    title: '保证金',
    dataIndex: 'amount',

    align: 'left',

    customRender: ({ record }) => {
      return record.tenderResponse?.amount || '-';
    },
  },
  {
    title: '标书类型',
    dataIndex: 'documentType',

    align: 'left',

    customRender: ({ record }) => {
      const obj = {
        10: '电子',
        11: '纸质',
      };
      return obj[record.tenderResponse?.documentType] || '-';
    },
  },
  {
    title: '对接人电话',
    dataIndex: 'comment',

    align: 'left',

    customRender: ({ record }) => {
      return record.tenderResponse?.comment || '-';
    },
  },
  {
    title: '投标资料清单',
    dataIndex: 'url',
    slots: { customRender: 'tenderResponseUrl' },
    align: 'left',
  },
  {
    title: '支付凭证附件',
    dataIndex: 'voucher',
    slots: { customRender: 'tenderResponseUrlPay' },
    align: 'left',
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',

    align: 'left',

    customRender: ({ record }) => {
      return record.tenderResponse?.createTime || '-';
    },
  },
  {
    title: '操作',
    dataIndex: 'tenderResponseAction',
    slots: { customRender: 'tenderResponseAction' },

    width: 80,
    align: 'left',
  },
];
